package com.kcwl.idea.plugins.base.constants;

import java.util.HashMap;

public class KcKeyManager {

    private static KcKeyManager kcKeyManager = new KcKeyManager();

    private final String defaultKey = "123456kcwl654321";

    private HashMap<String, String> paramPriKeyMap;

    private KcKeyManager() {
        initKey();
    }

    public static KcKeyManager getInstance(){
        return kcKeyManager;
    }

    public String getParamPrivateKey(String productType) {
        String paramKey =paramPriKeyMap.get(productType);
        return (paramKey!=null) ? paramKey : defaultKey;
    }

    private void initKey() {
        paramPriKeyMap = new HashMap<>();
        paramPriKeyMap.put("carrier-app", defaultKey);
        paramPriKeyMap.put("shipper-app", defaultKey);
        paramPriKeyMap.put("shipper-web", "sw7109@kcwl#ygds");
        paramPriKeyMap.put("spms-web", "op1102$kcwl#sxty");
        paramPriKeyMap.put("opms-web", "ic8112$kcwl#sxty");
        paramPriKeyMap.put("tms-web", "tm5113$kcwl@qycd");
        paramPriKeyMap.put("bpms-web", "bp6114$kcwl#jymm");
        paramPriKeyMap.put("fmgt-web", "fg1102$kcwl#sxty");
        paramPriKeyMap.put("da-web", "da1102$kcwl#sxty");
        paramPriKeyMap.put("services-web", "se1102$kcwl#sxty");

    }
}
